#! /bin/bash
export LANG=zh_CN.UTF-8
HIVE_HOME=/usr/bin/hive


${HIVE_HOME} -S -e "

create database if not exists edu_dwb;

create table edu_dwb.dwb_customer_relationship_wide(
         id string comment '意向id',
         payment_time string comment '支付时间',
         payment_state string comment '是否是一个报名用户',
         update_date_time string comment '最后更新时间',
         deleted string comment '是否被删除',
         customer_id string comment '所属客户id',
         origin_type string comment '数据来源',
         itcast_clazz_id string comment '所属班级id',
         origin_channel string comment '来源渠道',
         creator string comment '销售的id',
         -- customer_clue
         clue_state string comment '新老学员标记字段',
         --empioyee
         tdepart_id string comment '员工所在的部门id',
         --scrm_department
         name string comment '部门名称',
         --itcast_clazz
         clazz_id string,
         itcast_school_id string comment '校区id',
         itcast_school_name string comment '校区名称',
         itcast_subject_id string comment '学科id',
         itcast_subject_name string comment '学科名称',
         --customer_appeal
         appeal_status string comment '申诉状态'
)row format delimited
fields terminated by '\t'
stored as orc
tblproperties ('orc.compress' = 'snappy');
